<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html lang="en">

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>LCOV - id:000977,sync:fuzzer2,src:001052.lcov_info_final - test/gmock-1.7.0/gtest/include/gtest/gtest-message.h</title>
  <link rel="stylesheet" type="text/css" href="../../../../../gcov.css">
</head>

<body>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
    <tr><td class="title">LCOV - code coverage report</td></tr>
    <tr><td class="ruler"><img src="../../../../../glass.png" width=3 height=3 alt=""></td></tr>

    <tr>
      <td width="100%">
        <table cellpadding=1 border=0 width="100%">
          <tr>
            <td width="10%" class="headerItem">Current view:</td>
            <td width="35%" class="headerValue"><a href="../../../../../index.html">top level</a> - <a href="index.html">test/gmock-1.7.0/gtest/include/gtest</a> - gtest-message.h<span style="font-size: 80%;"> (source / <a href="gtest-message.h.func-sort-c.html">functions</a>)</span></td>
            <td width="5%"></td>
            <td width="15%"></td>
            <td width="10%" class="headerCovTableHead">Hit</td>
            <td width="10%" class="headerCovTableHead">Total</td>
            <td width="15%" class="headerCovTableHead">Coverage</td>
          </tr>
          <tr>
            <td class="headerItem">Test:</td>
            <td class="headerValue">id:000977,sync:fuzzer2,src:001052.lcov_info_final</td>
            <td></td>
            <td class="headerItem">Lines:</td>
            <td class="headerCovTableEntry">0</td>
            <td class="headerCovTableEntry">16</td>
            <td class="headerCovTableEntryLo">0.0 %</td>
          </tr>
          <tr>
            <td class="headerItem">Date:</td>
            <td class="headerValue">2016-03-13 10:42:47</td>
            <td></td>
            <td class="headerItem">Functions:</td>
            <td class="headerCovTableEntry">0</td>
            <td class="headerCovTableEntry">64</td>
            <td class="headerCovTableEntryLo">0.0 %</td>
          </tr>
          <tr><td><img src="../../../../../glass.png" width=3 height=3 alt=""></td></tr>
        </table>
      </td>
    </tr>

    <tr><td class="ruler"><img src="../../../../../glass.png" width=3 height=3 alt=""></td></tr>
  </table>

  <table cellpadding=0 cellspacing=0 border=0>
    <tr>
      <td><br></td>
    </tr>
    <tr>
      <td>
<pre class="sourceHeading">          Line data    Source code</pre>
<pre class="source">
<a name="1"><span class="lineNum">       1 </span>            : // Copyright 2005, Google Inc.</a>
<span class="lineNum">       2 </span>            : // All rights reserved.
<span class="lineNum">       3 </span>            : //
<span class="lineNum">       4 </span>            : // Redistribution and use in source and binary forms, with or without
<span class="lineNum">       5 </span>            : // modification, are permitted provided that the following conditions are
<span class="lineNum">       6 </span>            : // met:
<span class="lineNum">       7 </span>            : //
<span class="lineNum">       8 </span>            : //     * Redistributions of source code must retain the above copyright
<span class="lineNum">       9 </span>            : // notice, this list of conditions and the following disclaimer.
<span class="lineNum">      10 </span>            : //     * Redistributions in binary form must reproduce the above
<span class="lineNum">      11 </span>            : // copyright notice, this list of conditions and the following disclaimer
<span class="lineNum">      12 </span>            : // in the documentation and/or other materials provided with the
<span class="lineNum">      13 </span>            : // distribution.
<span class="lineNum">      14 </span>            : //     * Neither the name of Google Inc. nor the names of its
<span class="lineNum">      15 </span>            : // contributors may be used to endorse or promote products derived from
<span class="lineNum">      16 </span>            : // this software without specific prior written permission.
<span class="lineNum">      17 </span>            : //
<span class="lineNum">      18 </span>            : // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
<span class="lineNum">      19 </span>            : // &quot;AS IS&quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
<span class="lineNum">      20 </span>            : // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
<span class="lineNum">      21 </span>            : // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
<span class="lineNum">      22 </span>            : // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
<span class="lineNum">      23 </span>            : // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
<span class="lineNum">      24 </span>            : // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
<span class="lineNum">      25 </span>            : // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
<span class="lineNum">      26 </span>            : // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
<span class="lineNum">      27 </span>            : // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
<span class="lineNum">      28 </span>            : // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<span class="lineNum">      29 </span>            : //
<span class="lineNum">      30 </span>            : // Author: wan@google.com (Zhanyong Wan)
<span class="lineNum">      31 </span>            : //
<span class="lineNum">      32 </span>            : // The Google C++ Testing Framework (Google Test)
<span class="lineNum">      33 </span>            : //
<span class="lineNum">      34 </span>            : // This header file defines the Message class.
<span class="lineNum">      35 </span>            : //
<span class="lineNum">      36 </span>            : // IMPORTANT NOTE: Due to limitation of the C++ language, we have to
<span class="lineNum">      37 </span>            : // leave some internal implementation details in this header file.
<span class="lineNum">      38 </span>            : // They are clearly marked by comments like this:
<span class="lineNum">      39 </span>            : //
<span class="lineNum">      40 </span>            : //   // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
<span class="lineNum">      41 </span>            : //
<span class="lineNum">      42 </span>            : // Such code is NOT meant to be used by a user directly, and is subject
<span class="lineNum">      43 </span>            : // to CHANGE WITHOUT NOTICE.  Therefore DO NOT DEPEND ON IT in a user
<span class="lineNum">      44 </span>            : // program!
<span class="lineNum">      45 </span>            : 
<span class="lineNum">      46 </span>            : #ifndef GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_
<span class="lineNum">      47 </span>            : #define GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_
<span class="lineNum">      48 </span>            : 
<span class="lineNum">      49 </span>            : #include &lt;limits&gt;
<span class="lineNum">      50 </span>            : 
<span class="lineNum">      51 </span>            : #include &quot;gtest/internal/gtest-port.h&quot;
<span class="lineNum">      52 </span>            : 
<span class="lineNum">      53 </span>            : // Ensures that there is at least one operator&lt;&lt; in the global namespace.
<span class="lineNum">      54 </span>            : // See Message&amp; operator&lt;&lt;(...) below for why.
<span class="lineNum">      55 </span>            : void operator&lt;&lt;(const testing::internal::Secret&amp;, int);
<span class="lineNum">      56 </span>            : 
<span class="lineNum">      57 </span>            : namespace testing {
<span class="lineNum">      58 </span>            : 
<span class="lineNum">      59 </span>            : // The Message class works like an ostream repeater.
<span class="lineNum">      60 </span>            : //
<span class="lineNum">      61 </span>            : // Typical usage:
<span class="lineNum">      62 </span>            : //
<span class="lineNum">      63 </span>            : //   1. You stream a bunch of values to a Message object.
<span class="lineNum">      64 </span>            : //      It will remember the text in a stringstream.
<span class="lineNum">      65 </span>            : //   2. Then you stream the Message object to an ostream.
<span class="lineNum">      66 </span>            : //      This causes the text in the Message to be streamed
<span class="lineNum">      67 </span>            : //      to the ostream.
<span class="lineNum">      68 </span>            : //
<span class="lineNum">      69 </span>            : // For example;
<span class="lineNum">      70 </span>            : //
<span class="lineNum">      71 </span>            : //   testing::Message foo;
<span class="lineNum">      72 </span>            : //   foo &lt;&lt; 1 &lt;&lt; &quot; != &quot; &lt;&lt; 2;
<span class="lineNum">      73 </span>            : //   std::cout &lt;&lt; foo;
<span class="lineNum">      74 </span>            : //
<span class="lineNum">      75 </span>            : // will print &quot;1 != 2&quot;.
<span class="lineNum">      76 </span>            : //
<span class="lineNum">      77 </span>            : // Message is not intended to be inherited from.  In particular, its
<span class="lineNum">      78 </span>            : // destructor is not virtual.
<span class="lineNum">      79 </span>            : //
<span class="lineNum">      80 </span>            : // Note that stringstream behaves differently in gcc and in MSVC.  You
<span class="lineNum">      81 </span>            : // can stream a NULL char pointer to it in the former, but not in the
<span class="lineNum">      82 </span>            : // latter (it causes an access violation if you do).  The Message
<a name="83"><span class="lineNum">      83 </span>            : // class hides this difference by treating a NULL char pointer as</a>
<span class="lineNum">      84 </span>            : // &quot;(null)&quot;.
<span class="lineNum">      85 </span><span class="lineNoCov">          0 : class GTEST_API_ Message {</span>
<span class="lineNum">      86 </span>            :  private:
<span class="lineNum">      87 </span>            :   // The type of basic IO manipulators (endl, ends, and flush) for
<span class="lineNum">      88 </span>            :   // narrow streams.
<span class="lineNum">      89 </span>            :   typedef std::ostream&amp; (*BasicNarrowIoManip)(std::ostream&amp;);
<span class="lineNum">      90 </span>            : 
<span class="lineNum">      91 </span>            :  public:
<span class="lineNum">      92 </span>            :   // Constructs an empty Message.
<span class="lineNum">      93 </span>            :   Message();
<a name="94"><span class="lineNum">      94 </span>            : </a>
<span class="lineNum">      95 </span>            :   // Copy constructor.
<span class="lineNum">      96 </span><span class="lineNoCov">          0 :   Message(const Message&amp; msg) : ss_(new ::std::stringstream) {  // NOLINT</span>
<span class="lineNum">      97 </span><span class="lineNoCov">          0 :     *ss_ &lt;&lt; msg.GetString();</span>
<span class="lineNum">      98 </span><span class="lineNoCov">          0 :   }</span>
<span class="lineNum">      99 </span>            : 
<span class="lineNum">     100 </span>            :   // Constructs a Message from a C-string.
<span class="lineNum">     101 </span>            :   explicit Message(const char* str) : ss_(new ::std::stringstream) {
<span class="lineNum">     102 </span>            :     *ss_ &lt;&lt; str;
<span class="lineNum">     103 </span>            :   }
<span class="lineNum">     104 </span>            : 
<span class="lineNum">     105 </span>            : #if GTEST_OS_SYMBIAN
<span class="lineNum">     106 </span>            :   // Streams a value (either a pointer or not) to this object.
<span class="lineNum">     107 </span>            :   template &lt;typename T&gt;
<span class="lineNum">     108 </span>            :   inline Message&amp; operator &lt;&lt;(const T&amp; value) {
<span class="lineNum">     109 </span>            :     StreamHelper(typename internal::is_pointer&lt;T&gt;::type(), value);
<span class="lineNum">     110 </span>            :     return *this;
<span class="lineNum">     111 </span>            :   }
<span class="lineNum">     112 </span>            : #else
<a name="113"><span class="lineNum">     113 </span>            :   // Streams a non-pointer value to this object.</a>
<span class="lineNum">     114 </span>            :   template &lt;typename T&gt;
<span class="lineNum">     115 </span><span class="lineNoCov">          0 :   inline Message&amp; operator &lt;&lt;(const T&amp; val) {</span>
<span class="lineNum">     116 </span>            :     // Some libraries overload &lt;&lt; for STL containers.  These
<span class="lineNum">     117 </span>            :     // overloads are defined in the global namespace instead of ::std.
<span class="lineNum">     118 </span>            :     //
<span class="lineNum">     119 </span>            :     // C++'s symbol lookup rule (i.e. Koenig lookup) says that these
<span class="lineNum">     120 </span>            :     // overloads are visible in either the std namespace or the global
<span class="lineNum">     121 </span>            :     // namespace, but not other namespaces, including the testing
<span class="lineNum">     122 </span>            :     // namespace which Google Test's Message class is in.
<span class="lineNum">     123 </span>            :     //
<span class="lineNum">     124 </span>            :     // To allow STL containers (and other types that has a &lt;&lt; operator
<span class="lineNum">     125 </span>            :     // defined in the global namespace) to be used in Google Test
<span class="lineNum">     126 </span>            :     // assertions, testing::Message must access the custom &lt;&lt; operator
<span class="lineNum">     127 </span>            :     // from the global namespace.  With this using declaration,
<span class="lineNum">     128 </span>            :     // overloads of &lt;&lt; defined in the global namespace and those
<span class="lineNum">     129 </span>            :     // visible via Koenig lookup are both exposed in this function.
<span class="lineNum">     130 </span>            :     using ::operator &lt;&lt;;
<span class="lineNum">     131 </span><span class="lineNoCov">          0 :     *ss_ &lt;&lt; val;</span>
<span class="lineNum">     132 </span><span class="lineNoCov">          0 :     return *this;</span>
<span class="lineNum">     133 </span>            :   }
<span class="lineNum">     134 </span>            : 
<span class="lineNum">     135 </span>            :   // Streams a pointer value to this object.
<span class="lineNum">     136 </span>            :   //
<span class="lineNum">     137 </span>            :   // This function is an overload of the previous one.  When you
<span class="lineNum">     138 </span>            :   // stream a pointer to a Message, this definition will be used as it
<span class="lineNum">     139 </span>            :   // is more specialized.  (The C++ Standard, section
<span class="lineNum">     140 </span>            :   // [temp.func.order].)  If you stream a non-pointer, then the
<span class="lineNum">     141 </span>            :   // previous definition will be used.
<span class="lineNum">     142 </span>            :   //
<span class="lineNum">     143 </span>            :   // The reason for this overload is that streaming a NULL pointer to
<span class="lineNum">     144 </span>            :   // ostream is undefined behavior.  Depending on the compiler, you
<span class="lineNum">     145 </span>            :   // may get &quot;0&quot;, &quot;(nil)&quot;, &quot;(null)&quot;, or an access violation.  To
<span class="lineNum">     146 </span>            :   // ensure consistent result across compilers, we always treat NULL
<a name="147"><span class="lineNum">     147 </span>            :   // as &quot;(null)&quot;.</a>
<span class="lineNum">     148 </span>            :   template &lt;typename T&gt;
<span class="lineNum">     149 </span><span class="lineNoCov">          0 :   inline Message&amp; operator &lt;&lt;(T* const&amp; pointer) {  // NOLINT</span>
<span class="lineNum">     150 </span><span class="lineNoCov">          0 :     if (pointer == NULL) {</span>
<span class="lineNum">     151 </span><span class="lineNoCov">          0 :       *ss_ &lt;&lt; &quot;(null)&quot;;</span>
<span class="lineNum">     152 </span>            :     } else {
<span class="lineNum">     153 </span><span class="lineNoCov">          0 :       *ss_ &lt;&lt; pointer;</span>
<span class="lineNum">     154 </span>            :     }
<span class="lineNum">     155 </span><span class="lineNoCov">          0 :     return *this;</span>
<span class="lineNum">     156 </span>            :   }
<span class="lineNum">     157 </span>            : #endif  // GTEST_OS_SYMBIAN
<span class="lineNum">     158 </span>            : 
<span class="lineNum">     159 </span>            :   // Since the basic IO manipulators are overloaded for both narrow
<span class="lineNum">     160 </span>            :   // and wide streams, we have to provide this specialized definition
<span class="lineNum">     161 </span>            :   // of operator &lt;&lt;, even though its body is the same as the
<span class="lineNum">     162 </span>            :   // templatized version above.  Without this definition, streaming
<span class="lineNum">     163 </span>            :   // endl or other basic IO manipulators to Message will confuse the
<span class="lineNum">     164 </span>            :   // compiler.
<span class="lineNum">     165 </span>            :   Message&amp; operator &lt;&lt;(BasicNarrowIoManip val) {
<span class="lineNum">     166 </span>            :     *ss_ &lt;&lt; val;
<span class="lineNum">     167 </span>            :     return *this;
<span class="lineNum">     168 </span>            :   }
<span class="lineNum">     169 </span>            : 
<span class="lineNum">     170 </span>            :   // Instead of 1/0, we want to see true/false for bool values.
<span class="lineNum">     171 </span>            :   Message&amp; operator &lt;&lt;(bool b) {
<span class="lineNum">     172 </span>            :     return *this &lt;&lt; (b ? &quot;true&quot; : &quot;false&quot;);
<span class="lineNum">     173 </span>            :   }
<span class="lineNum">     174 </span>            : 
<span class="lineNum">     175 </span>            :   // These two overloads allow streaming a wide C string to a Message
<span class="lineNum">     176 </span>            :   // using the UTF-8 encoding.
<span class="lineNum">     177 </span>            :   Message&amp; operator &lt;&lt;(const wchar_t* wide_c_str);
<span class="lineNum">     178 </span>            :   Message&amp; operator &lt;&lt;(wchar_t* wide_c_str);
<span class="lineNum">     179 </span>            : 
<span class="lineNum">     180 </span>            : #if GTEST_HAS_STD_WSTRING
<span class="lineNum">     181 </span>            :   // Converts the given wide string to a narrow string using the UTF-8
<span class="lineNum">     182 </span>            :   // encoding, and streams the result to this Message object.
<span class="lineNum">     183 </span>            :   Message&amp; operator &lt;&lt;(const ::std::wstring&amp; wstr);
<span class="lineNum">     184 </span>            : #endif  // GTEST_HAS_STD_WSTRING
<span class="lineNum">     185 </span>            : 
<span class="lineNum">     186 </span>            : #if GTEST_HAS_GLOBAL_WSTRING
<span class="lineNum">     187 </span>            :   // Converts the given wide string to a narrow string using the UTF-8
<span class="lineNum">     188 </span>            :   // encoding, and streams the result to this Message object.
<span class="lineNum">     189 </span>            :   Message&amp; operator &lt;&lt;(const ::wstring&amp; wstr);
<span class="lineNum">     190 </span>            : #endif  // GTEST_HAS_GLOBAL_WSTRING
<span class="lineNum">     191 </span>            : 
<span class="lineNum">     192 </span>            :   // Gets the text streamed to this object so far as an std::string.
<span class="lineNum">     193 </span>            :   // Each '\0' character in the buffer is replaced with &quot;\\0&quot;.
<span class="lineNum">     194 </span>            :   //
<span class="lineNum">     195 </span>            :   // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
<span class="lineNum">     196 </span>            :   std::string GetString() const;
<span class="lineNum">     197 </span>            : 
<span class="lineNum">     198 </span>            :  private:
<span class="lineNum">     199 </span>            : 
<span class="lineNum">     200 </span>            : #if GTEST_OS_SYMBIAN
<span class="lineNum">     201 </span>            :   // These are needed as the Nokia Symbian Compiler cannot decide between
<span class="lineNum">     202 </span>            :   // const T&amp; and const T* in a function template. The Nokia compiler _can_
<span class="lineNum">     203 </span>            :   // decide between class template specializations for T and T*, so a
<span class="lineNum">     204 </span>            :   // tr1::type_traits-like is_pointer works, and we can overload on that.
<span class="lineNum">     205 </span>            :   template &lt;typename T&gt;
<span class="lineNum">     206 </span>            :   inline void StreamHelper(internal::true_type /*is_pointer*/, T* pointer) {
<span class="lineNum">     207 </span>            :     if (pointer == NULL) {
<span class="lineNum">     208 </span>            :       *ss_ &lt;&lt; &quot;(null)&quot;;
<span class="lineNum">     209 </span>            :     } else {
<span class="lineNum">     210 </span>            :       *ss_ &lt;&lt; pointer;
<span class="lineNum">     211 </span>            :     }
<span class="lineNum">     212 </span>            :   }
<span class="lineNum">     213 </span>            :   template &lt;typename T&gt;
<span class="lineNum">     214 </span>            :   inline void StreamHelper(internal::false_type /*is_pointer*/,
<span class="lineNum">     215 </span>            :                            const T&amp; value) {
<span class="lineNum">     216 </span>            :     // See the comments in Message&amp; operator &lt;&lt;(const T&amp;) above for why
<span class="lineNum">     217 </span>            :     // we need this using statement.
<span class="lineNum">     218 </span>            :     using ::operator &lt;&lt;;
<span class="lineNum">     219 </span>            :     *ss_ &lt;&lt; value;
<span class="lineNum">     220 </span>            :   }
<span class="lineNum">     221 </span>            : #endif  // GTEST_OS_SYMBIAN
<span class="lineNum">     222 </span>            : 
<span class="lineNum">     223 </span>            :   // We'll hold the text streamed to this object here.
<span class="lineNum">     224 </span>            :   const internal::scoped_ptr&lt; ::std::stringstream&gt; ss_;
<span class="lineNum">     225 </span>            : 
<span class="lineNum">     226 </span>            :   // We declare (but don't implement) this to prevent the compiler
<span class="lineNum">     227 </span>            :   // from implementing the assignment operator.
<span class="lineNum">     228 </span>            :   void operator=(const Message&amp;);
<span class="lineNum">     229 </span>            : };
<a name="230"><span class="lineNum">     230 </span>            : </a>
<span class="lineNum">     231 </span>            : // Streams a Message to an ostream.
<span class="lineNum">     232 </span><span class="lineNoCov">          0 : inline std::ostream&amp; operator &lt;&lt;(std::ostream&amp; os, const Message&amp; sb) {</span>
<span class="lineNum">     233 </span><span class="lineNoCov">          0 :   return os &lt;&lt; sb.GetString();</span>
<span class="lineNum">     234 </span>            : }
<span class="lineNum">     235 </span>            : 
<span class="lineNum">     236 </span>            : namespace internal {
<span class="lineNum">     237 </span>            : 
<span class="lineNum">     238 </span>            : // Converts a streamable value to an std::string.  A NULL pointer is
<span class="lineNum">     239 </span>            : // converted to &quot;(null)&quot;.  When the input value is a ::string,
<span class="lineNum">     240 </span>            : // ::std::string, ::wstring, or ::std::wstring object, each NUL
<a name="241"><span class="lineNum">     241 </span>            : // character in it is replaced with &quot;\\0&quot;.</a>
<span class="lineNum">     242 </span>            : template &lt;typename T&gt;
<span class="lineNum">     243 </span><span class="lineNoCov">          0 : std::string StreamableToString(const T&amp; streamable) {</span>
<span class="lineNum">     244 </span><span class="lineNoCov">          0 :   return (Message() &lt;&lt; streamable).GetString();</span>
<span class="lineNum">     245 </span>            : }
<span class="lineNum">     246 </span>            : 
<span class="lineNum">     247 </span>            : }  // namespace internal
<span class="lineNum">     248 </span>            : }  // namespace testing
<span class="lineNum">     249 </span>            : 
<span class="lineNum">     250 </span>            : #endif  // GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_
</pre>
      </td>
    </tr>
  </table>
  <br>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
    <tr><td class="ruler"><img src="../../../../../glass.png" width=3 height=3 alt=""></td></tr>
    <tr><td class="versionInfo">Generated by: <a href="http://ltp.sourceforge.net/coverage/lcov.php" target="_parent">LCOV version 1.11</a></td></tr>
  </table>
  <br>

</body>
</html>
